#pragma once

#include "stdafx.h"

class CHeightMap
{
public:
	CHeightMap();
	~CHeightMap();

private:
	BYTE			*m_pHeightMap;
	int				m_nWidth;
	int				m_nHeight;
	D3DXVECTOR3		m_vScale;

public:
	bool		LoadHeightMap(LPCTSTR pFileName,int nWidth, int nHeight);
	float		GetHeight(float fx, float fz, bool bReverseQuad= false);
	D3DXVECTOR3	GetHeightMapNormal(int x, int z);

	BYTE*		GetHeightMap()			{	return m_pHeightMap;		}
	D3DXVECTOR3	GetScale()				{	return m_vScale;			}
	int			GetHeightMapWidth()		{	return m_nWidth;			}
	int			GetHeightMapHeight()	{	return m_nHeight;			}
};
